package com.scu.phototabuser.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by tianfei on 2017/4/9.
 */

public class DateUtil {

    private static final SimpleDateFormat mFormat=new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");

    public static String date2String(final Date date){
        //默认格式的输出

        return date.toString();
    }

    public static String date2String(final Date date, SimpleDateFormat format){

        return format.format(date);
    }

    public static String date2String(final Date date,boolean needFormat){

        if (needFormat){
        return mFormat.format(date);}
        else {
            return date2String(date);
        }
    }



}
